
********************************************************************************
*
* Title:	DICTATORSHIPS AND WESTERN PR FIRMS 
*
* Authors: 	Adam Scharpf, Christian Gläßel, Alexander Dukalskis
*
* Journal:	Security Studies
*
* Date:		June 2025
*
********************************************************************************
*
* Content:	Replication of results in the manuscript and appendix
*
*			Steps:
*			1) Set working directory below ("Setting working directory in macro")
*			2) Run do-file
*			3) Replicate results and figures
*
********************************************************************************
*
* Packages: Before running this code, please make sure you have the following
*			.ado-files installed
*
*			- Parmest Package, Version 2
*					net install st0043_2.pkg
**
********************************************************************************


	version 16.0
	set more off

	clear all
 
 
********************************************************************************
*
* Setting working directory in macro
*
********************************************************************************

	*Insert path to folder containing replication datasets before running
	//Example: "C:\Users\me\Desktop\Dicatorship_PRFirms"
	global path="..." 
 
 
********************************************************************************
*
* Producing log-file of results
*
********************************************************************************

	*Start recording log file
	log using "$path\replication_log", replace

	
********************************************************************************
*
* Figures in manuscript
*
********************************************************************************	
	
	*Loading data
	use "$path\replication_data_analysis.dta"
	
	****************************************************************************
	*Figure 1 (a). Number of initiated contracts over time
	****************************************************************************	
	
	*Preserving data
	preserve
	
	*Generating decade variable for aggregation
	gen decade=1 if year>=1940 & year<1950 
	replace decade=2 if year>=1950 & year<1960
	replace decade=3 if year>=1960 & year<1970	
	replace decade=4 if year>=1970 & year<1980
	replace decade=5 if year>=1980 & year<1990	
	replace decade=6 if year>=1990 & year<2000	
	replace decade=7 if year>=2000 & year<2010	
	replace decade=8 if year>=2010 & year<2020		
	replace decade=9 if year>=2020	
		
	*Collapsing data 
	collapse (sum) firm_strict_count_start, by(decade vdem_autoc)
	
	*Identifying democracies
	replace vdem_autoc=0 if vdem_autoc==.
	
	*Graph
	#delimit ;
	twoway 	(
			connected firm_strict_count decade if vdem_autoc==1 & decade<9,
			lcolor(black)
			mlcolor(black)
			mfcolor(black)
			msize(*1.5)
			lpattern(solid)
			)			
			, 
		ysize(1)
		xsize(1.25)			
		yscale(range(0 7) noextend titlegap(+2))
		ylabel(0(100)500, angle(horizontal) nogrid ) 
		xscale(range(0.5 8.5) noextend titlegap(+3))		
		xlabel(1 `" "1940-" "1949 " "' 2 `" "1950-" "1959 " "' 3 `" "1960-" "1969 " "' 4 `" "1970-" "1979 " "'
			   5 `" "1980-" "1989 " "' 6 `" "1990-" "1999 " "' 7 `" "2000-" "2009 " "' 8 `" "2010-" "2019 " "'
			  , noticks labgap(+2))		
		xticks(1(1)8,tlength(*1))		
		ytitle("Number of contracts", size(*1))
		xtitle("Years", size(*1))
		legend(off)
		plotregion(lcolor(white)) 
		graphregion(color(white) lcolor(white) lalign(outside))			
	;
	#delimit cr
	graph export "$path\figure_1a.tif", as(tif) replace width(1500)		
	
	*Restoring data
	restore	

	
	****************************************************************************
	*Figure 1 (b). Share of hiring autocracies by type
	****************************************************************************	
	
	*Preserving data
	preserve	
	
	*Identifying PR using dictatorships
	bys gwf_casename (year): egen regime_firm=max(bin_firm_strict_count_start)
		
	*Collapsing data by dictatorship type 
	collapse (max) regime_firm gwf_party gwf_military gwf_personal gwf_monarchy , by(gwf_casename)	
	
	*Identifying dictatorship types using PR firms 
	gen party_firm=1    if regime_firm==1 & gwf_party==1
	gen military_firm=1 if regime_firm==1 & gwf_military==1
	gen personal_firm=1 if regime_firm==1 & gwf_personal==1		
	gen monarchy_firm=1 if regime_firm==1 & gwf_monarchy==1	
	
	*Collapsing data by type
	#delimit ;
	collapse (sum) party_firm 
				   military_firm 
				   personal_firm 
				   monarchy_firm 
				   gwf_party 
				   gwf_military 
				   gwf_personal 
				   gwf_monarchy
				   ;
	#delimit cr				   
				   
	*Calculating totals			   
	egen total_firm=rowtotal(party_firm military_firm personal_firm monarchy_firm)			   
	egen gwf_total=rowtotal(gwf_party gwf_military gwf_personal gwf_monarchy)	
	
	*Calculating shares
	foreach type in party military personal monarchy total {
		gen share_`type'_firm=(`type'_firm/gwf_`type')*100
	}
	
	*Reshaping data
	gen id=_n
	reshape long share_@, i(id) j() string
	rename share_ share
	
	*Generating x-axis
	gen xaxis=0 if _j=="total_firm"
	sort xaxis share
	replace xaxis=_n if xaxis==.
					
	*Graph
	#delimit ;	
	twoway (dropline share xaxis if xaxis==0, lwidth(*.5) msize(*1.4) lcolor(black) mcolor(black))
		   (dropline share xaxis if xaxis>0, lwidth(*.5) msize(*1.4) lcolor(gs8) mlcolor(gs8) mfcolor(white))
			, 
			yscale(range(0 100) noextend titlegap(*10))
			xscale(range(-.75 4.25) noextend titlegap(*10))
			ylabel(0(20)100, angle(horizontal) nogrid)
			xlabel(0 "Autocracies" 2 "Personal" 3 "Military" 4 "Party" 5 "Monarchy", labgap(*2.5) angle(45))
			ytitle("Share of regimes using firms (%)")						
			xtitle("")
			xline(1, lcolor(black) lpattern(dot))
			graphregion(color(white) lcolor(white) lalign(outside)  margin(r=30 l=30)) 			
			legend(off)
	;
	#delimit cr		
	graph export "$path\figure_1b.tif", as(tif) replace width(1500)			
	
	*Restoring data
	restore			
				
		
	****************************************************************************
	*Figure 2. Hiring of US-based PR firms by different dictatorships
	****************************************************************************			
		
	*Preserving data
	preserve	
			
	*Identifying first obs in each spell
	bys cowcode (year): gen fear_spell_start=1 if fear==1 & fear[_n-1]!=1 	
	bys cowcode (year): gen spin_spell_start=1 if spin==1 & spin[_n-1]!=1	
	
	*Giving each first obs a unique number
	egen id_fear_spell_start = group(cowcode fear_spell_start year)
	egen id_spin_spell_start = group(cowcode spin_spell_start year)
	
	*Filling down number till end of spell
	gen id_fear_spell = id_fear_spell_start
	bys cowcode (year): replace id_fear_spell = id_fear_spell[_n-1] if fear==1 & fear[_n-1]==1	
	
	gen id_spin_spell = id_spin_spell_start
	bys cowcode (year): replace id_spin_spell = id_spin_spell[_n-1] if spin==1 & spin[_n-1]==1
	
	*Identifying PR using dictatorships
	bys id_fear_spell (year): egen fear_firm=max(bin_firm_strict_count_start)
	bys id_spin_spell (year): egen spin_firm=max(bin_firm_strict_count_start)	
	
	*Collapsing data by dictatorship type 
	collapse (max) fear_firm spin_firm spin fear, by(id_fear_spell id_spin_spell)	
	
	*Deleting irrelevant regimes
	drop if id_fear_spell==. & id_spin_spell==.
	
	*Recoding firm numbers to missing for other regime type
	replace fear_firm=. if id_fear_spell==.
	replace spin_firm=. if id_spin_spell==.
	
	*Collapsing data by dictatorship type
	#delimit ;
	collapse (sum) fear_firm
				   spin_firm
				   fear
				   spin				   
				   ;
	#delimit cr			
	
	*Calculating shares 
	foreach type in spin fear {
		gen share_`type'_firm=(`type'_firm/`type')*100
	}
	
	*Reshaping data
	gen id=_n
	reshape long share_@, i(id) j() string
	rename share_ share
	
	*Generating xaxis
	sort share
	gen xaxis=_n if share!=.
	
	*Graph
	#delimit ;	
	twoway (dropline share xaxis, lwidth(*.5) msize(*1.4) lcolor(black) mcolor(black))
			, 
			yscale(range(0 100) noextend titlegap(*10))
			xscale(range(.75 2.25) noextend titlegap(*10))
			ylabel(0(20)100, angle(horizontal) nogrid)
			xlabel(1 "Spin" 2 "Fear", labgap(*2.5))
			ytitle("Share of dictatorships using firms (%)")						
			xtitle("")
			graphregion(color(white) lcolor(white) lalign(outside)  margin(r=40 l=40)) 			
			legend(off)
	;
	#delimit cr			
	graph export "$path\figure_2.tif", as(tif) replace width(1500)	
		
	*Restoring data
	restore					
				
	
	****************************************************************************
	*Figure 4. Distribution of the dependent variable
	****************************************************************************		
	
	*Graph
	#delimit ;
	hist firm_strict_count_start if vdem_autoc==1,
		 disc
		 barwidth(.75)
		 lcolor(black)
		 lwidth(*.5)
		 lalign(center)
		 fcolor(gs12)
	     ysize(1)
		 xsize(1.2)
		 yscale(range( ) noextend titlegap(+2))
		 xscale(range(0 15) noextend titlegap(+2))		 
	 	 ylabel(, angle(horizontal) nogrid ) 
		 xlabel(0(5)15)		 
		 xtitle("Number of contracts initiated")
		 graphregion(color(white) lcolor(white) lalign(outside) ) 			
	;
	#delimit cr		
	graph export "$path\figure_4.tif", as(tif) replace width(1500)		
		
	
	****************************************************************************
	*Figure 5. Substantive effects on the use of PR firms by dictatorships
	****************************************************************************		
		
	#delimit ;
	
	//Saving model to local
	local model_5=
	"	
	xtreg ln_firm_strict_count_start 
		c.l_rep_score
		c.l_v2x_corr		
		i.tournament
		c.l_cw_loint
		i.l_bin_coup_suc 		
		i.new_uspres
		i.cubancrisis 
		i.coldwarend	
		i.waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	"
	;
	
	//Running model
	`model_5';	
	
	//Calculating and storing effects
	margins, dydx(
				tournament
				l_rep_score
				l_v2x_corr
				l_cw_loint
				l_bin_coup_suc 		
				new_uspres
				cubancrisis 
				coldwarend	
				waronterror			 
			 )
			 at((asobserved) _all)		 
			 level(95) 
			 post;
	parmest, saving("$path\figure_5.dta", replace) format(estimate min95 max95);
	
	#delimit cr			
		
	*Loading effects data
	use "$path\figure_5.dta", clear	
	
	*Dropping irrelevant variables
	drop if regexm(parm, "^0")
	
	*Ordering variables
	count
	gen var_ord=(r(N)+1)-_n
	
	*Identifying logics
	gen logic = .
	replace logic = 1 if regexm(parm, "reprss") | regexm(parm, "corr")	
	replace logic = 2 if regexm(parm, "tour")
	replace logic = 3 if regexm(parm, "cw") | regexm(parm, "coup")
	replace logic = 4 if regexm(parm, "new") | regexm(parm, "cuba") | regexm(parm, "cold") | regexm(parm, "war")
	
	*Graph
	#delimit ;
	twoway (rspike min95 max95 var_ord, horizontal
			lcolor(black)
			)
			(scatter var_ord estimate,
			mcolor(black)
			msize(*1.2)
			)
			,
			ysize(1)
			xsize(1.6)			
			yscale(range(0.5 9.25) noextend titlegap(*+5))
			xscale(range(-.4 .4) noextend titlegap(*+7))
			ylabel(
				9	"Repression"
				8	"Corruption"
				7	"Sports tournament"	
				6	"Civil war"
				5 	"Successful coup"
				4	"New US president"
				3	"Cuba problem"
				2	"Cold War end"
				1	"War on Terror start"			
				, angle(horizontal) nogrid labgap(+1.5))
			xlabel(-.4(.2).4)
			ytitle("")
			xtitle("Marginal effect on number of contracts (log)")
			graphregion(color(white) lcolor(white) lalign(outside) margin(r=+25)) 			
			xline(0, lpattern(dot) lcolor(black))
			yline(4.5 6.5 7.5, lpattern(solid) lcolor(gs10) lwidth(*.5))
			legend(off)
			text(8.5 .55 "{it}Countering" "{it}Criticism", orientation(horizontal))
			text(7 .55 "{it}Maximizing" "{it}Publicity", orientation(horizontal))
			text(5.5 .55 "{it}Stabilizing" "{it}Support", orientation(horizontal))
			text(2.5 .55 "{it}Signaling" "{it}Allegiance", orientation(horizontal))
			;
	#delimit cr	
	graph export "$path\figure_5.tif", as(tif) replace width(1500)		
	
		
	****************************************************************************
	*Figure 6. Countering criticism in the case of Togo
	****************************************************************************	
	
	*Loading data
	use "$path\replication_data_analysis.dta", clear	
	
	*Preserving data
	preserve
	
	*Keeping only observations for Togo
	keep if id_autoc_spell==121
		
	*Generating bars for plotting		
	sum firm_strict_count_start if id_autoc_spell==121
	gen rep_bar=r(max)+1 if id_autoc_spell==121	

	*Graph
	#delimit ;
	twoway  (spike firm_strict_count_start year if id_autoc_spell==121 & (year>=1967 & year<=2013), 
			lcolor(black) lpattern(solid) lwidth(*1.5) yaxis(1))
		   (connected rep_score year if id_autoc_spell==121  & (year>=1967 & year<=2013), 
			lcolor(black) mlcolor(black) mfcolor(white) lpattern(shortdash) yaxis(2)) 
		   
		   (scatteri 8.1 2013 8.1 2005.2, recast(line) lcolor(black) lwidth(medium) lwidth(*.5) yaxis(2))
		   (scatteri 8.1 2005.2 8.0 2005.2, recast(line) lcolor(black) lwidth(medium) lwidth(*.5) yaxis(2))
		   (scatteri 8.1 2013 8.0 2013, recast(line) lcolor(black) lwidth(medium) lwidth(*.5) yaxis(2))		   
		   
		   (scatteri 8.1 1967 8.1 2004.8, recast(line) lcolor(black) lwidth(medium) lwidth(*.5) yaxis(2))
		   (scatteri 8.1 1967 8.0 1967, recast(line) lcolor(black) lwidth(medium) lwidth(*.5) yaxis(2))
		   (scatteri 8.1 2004.8 8.0 2004.8, recast(line) lcolor(black) lwidth(medium) lwidth(*.5) yaxis(2))			   
		   , 
		   ysize(1)
		   xsize(1.35)
		   yscale(range() noextend titlegap(*10) axis(1))
		   yscale(range(3 7) noextend titlegap(*10) axis(2))		   
		   xscale(range(1970 2013) noextend titlegap(*10))		   
   		   ytitle("Number of PR firm contracts initiated", axis(1))
   		   ytitle("Repression", axis(2))		   
		   xtitle("Year")
		   ylabel(0(1)4, angle(horizontal) nogrid axis(1))
   		   ylabel(3(1)8, angle(horizontal) nogrid axis(2))
		   xlabel(1970(10)2010)
		   xtick(1965(5)2015, tlength(*.5))
		   legend(off)
		   graphregion(color(white) lcolor(white) lalign(outside) margin(t=+2.5))
		   text(8.4 1987 "Gnassingbé" "Eyadéma", size(*.8) placement(c) yaxis(2))		   
		   text(8.4 2009 "Faure" "Gnassingbé", size(*.8) placement(c) yaxis(2))	
		   ;
	#delimit cr
	graph export "$path\figure_6.tif", as(tif) replace width(1500)	
	
	*Restoring data
	restore
		
		
	****************************************************************************
	*Figure 7. Maximizing publicity in the case of Qatar
	****************************************************************************					
	
	*Preserving data
	preserve	
	
	*Keeping only observations for Qatar
	keep if id_autoc_spell==189
	
	*Generating bars for plotting
	sum firm_strict_count_start if id_autoc_spell==189
	gen tournament_bar=r(max)+1 if tournament==1 & id_autoc_spell==189	
	
	*Graph
	#delimit ;
	twoway (spike tournament_bar year if id_autoc_spell==189 & year>=1970, 
			lcolor(gs14) lwidth(*8)) 
		   (spike firm_strict_count_start year if id_autoc_spell==189 & tournament!=. & year>=1970, 
		    lcolor(black) lpattern(solid) lwidth(*1.5))
		   (spike firm_strict_count_start year if id_autoc_spell==189 & tournament==1 & year>=1970, 
		    lcolor(black) lpattern(solid) lwidth(*1.5))
		   
		   (scatteri 16.0 1972 16.0 1995.3, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 15.5 1972 16.0 1972, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 15.5 1995.3 16.0 1995.3, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))		   
		   
		   (scatteri 16.0 1995.6 16.0 2013.3, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 15.5 2013.3 16.0 2013.3, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 15.5 1995.6 16.0 1995.6, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))	

		   (scatteri 16.0 2013.6 16.0 2022.6, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 15.5 2022.6 16.0 2022.6, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 15.5 2013.6 16.0 2013.6, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))			   
		   , 
		   ysize(1)
		   xsize(1.25)
		   yscale(range(0 16) noextend titlegap(*10))   
		   xscale(range(1970 2020) noextend titlegap(*10))		   
   		   ytitle("Number of PR firm contracts initiated")
 		   xtitle("Year")
		   ylabel(0(5)15, angle(horizontal) nogrid)
		   xlabel(1970(10)2020)
		   xtick(1970(5)2020, tlength(*.5))
		   legend(off)
		   graphregion(color(white) lcolor(white) lalign(outside) margin(t=+2.5))
		   text(16.8 1985 "Khalifa bin Hamad" "Al Thani",size(*.8) placement(c))		   
		   text(16.8 2004 "Hamad bin Khalifa" "Al Thani",size(*.8) placement(c))	
		   text(16.8 2018 "Tamim bin Hamad" "Al Thani",size(*.8) placement(c))
		   ;
	#delimit cr			
	graph export "$path\figure_7.tif", as(tif) replace width(1500)	
	
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Figure 8. Stabilizing support in the case of the Philippines
	****************************************************************************	
		
	*Preserving data
	preserve	
	
	*Keeping only observations for Philippines
	keep if id_autoc_spell==229
				
	*Generating bars for plotting
	sum firm_strict_count_start if id_autoc_spell==229
	gen coup_bar=r(max)+1 if bin_coup_suc==1 & id_autoc_spell==229	
	
	*Graph
	#delimit ;
	twoway (spike coup_bar year if id_autoc_spell==229 & year>=1950, 
			 lcolor(gs14) lwidth(*9)) 
		   (spike firm_strict_count_start year if id_autoc_spell==229 & bin_coup_suc!=1 & year>=1950, 
		    lcolor(black) lpattern(solid) lwidth(*1.5))
		   (spike firm_strict_count_start year if id_autoc_spell==229 & bin_coup_suc==1 & year>=1950, 
		    lcolor(black) lpattern(solid) lwidth(*1.5))
		   (spike firm_strict_count_start year if id_autoc_spell==229 & year>=1950, 
		    lcolor(black) lpattern(solid) lwidth(*1.5))		   
		   
		   (scatteri 7.0 1954 7.0 1957.2, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 7.0 1954 6.75 1954, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 7.0 1957.2 6.75 1957.2, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))		   

		   (scatteri 7.0 1961.9 7.0 1957.4, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 7.0 1961.9 6.75 1961.9, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 7.0 1957.4 6.75 1957.4, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))		   

		   (scatteri 7.0 1965.9 7.0 1962.2, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 7.0 1962.2 6.75 1962.2, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 7.0 1965.9 6.75 1965.9, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))			   

		   (scatteri 7.0 1966.1 7.0 1986.4, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 7.0 1986.4 6.75 1986.4, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 7.0 1966.1 6.75 1966.1, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))		

		   (scatteri 7.0 1987.4 7.0 1986.6, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 7.0 1986.6 6.75 1986.6, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 7.0 1987.4 6.75 1987.4, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))				   
		   , 
		   ysize(1)
		   xsize(1.25)
		   yscale(range(0 7) noextend titlegap(*10))   
		   xscale(range() noextend titlegap(*10))		   
   		   ytitle("Number of PR firm contracts initiated")
 		   xtitle("Year")
		   ylabel(0(2)6, angle(horizontal) nogrid)
		   xlabel(1950(10)1990)
		   xtick(1950(5)1990, tlength(*.5))
		   legend(off)
		   graphregion(color(white) lcolor(white) lalign(outside) margin(t=+2.5))

		   text(7.4 1954.5 "Ramon" "Magsaysay",size(*.8) placement(c))				   
		   text(7.4 1959.5 "Carlos P." "Garcia",size(*.8) placement(c))			   
		   text(7.4 1964.5 "Diosdado" "Macapagal",size(*.8) placement(c))		   
		   text(7.4 1975.5 "Ferdinand" "Marcos",size(*.8) placement(c))	
		   text(7.4 1987 "Corazon" "Aquino",size(*.8) placement(c))		   
		   ;
	#delimit cr		
	graph export "$path\figure_8.tif", as(tif) replace width(1500)		
		
	*Restoring data
	restore	
	
	
	****************************************************************************
	*Figure 9. Signaling allegiance in the case of the Democratic Republic of Congo
	****************************************************************************		
	
	*Preserving data
	preserve	
	
	*Keeping only observations for DRC
	keep if id_autoc_spell==130		

	*Generating bars for plotting
	sum firm_strict_count_start if id_autoc_spell==130
	gen coldwar_bar_drc=r(max)+1 if coldwarend==1 & id_autoc_spell==130		
	
	*Graph
	#delimit ;
	twoway (spike coldwar_bar_drc year if id_autoc_spell==130 & year>=1960,
			lcolor(gs14) lwidth(*7)) 
		   (spike firm_strict_count_start year if id_autoc_spell==130 & year>=1960, 
		    lcolor(black) lpattern(solid) lwidth(*1.5))
		   (spike firm_strict_count_start year if id_autoc_spell==130 & year>=1960, 
		    lcolor(black) lpattern(solid) lwidth(*1.5))  		   
		   
		   (scatteri 6.0 1960 6.0 1965.8, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 6.0 1965.8 5.8 1965.8, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 6.0 1960 5.8 1960, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))	

		   (scatteri 6.0 1966.2 6.0 1997.2, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 6.0 1966.2 5.8 1966.2, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 6.0 1997.2 5.8 1997.2, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))		   

		   (scatteri 6.0 2000.8 6.0 1997.6, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 6.0 1997.6 5.8 1997.6, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 6.0 2000.8 5.8 2000.8, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))				   
		   
		   (scatteri 6.0 2001.2 6.0 2019, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 6.0 2001.2 5.8 2001.2, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))
		   (scatteri 6.0 2019 5.8 2019, recast(line) lcolor(black) lwidth(medium) lwidth(*.5))				   
		   		   
		   , 
		   ysize(1)
		   xsize(1.25)
		   yscale(range(0 6) noextend titlegap(*10))   
		   xscale(range(1960 2020) noextend titlegap(*10))		   
   		   ytitle("Number of PR firm contracts initiated")
 		   xtitle("Year")
		   ylabel(0(2)6, angle(horizontal) nogrid)
		   xlabel(1960(10)2020)
		   xtick(1960(5)2020, tlength(*.5))
		   legend(off)
		   graphregion(color(white) lcolor(white) lalign(outside) margin(t=+2.5))	   
		   text(6.3 1963 "Joseph" "Kasa-Vubu",size(*.8) placement(c))				   
		   text(6.3 1981 "Mobutu Sese" "Seko",size(*.8) placement(c))			   
		   text(6.3 1999.5 "Laurent-Désiré" "Kabila",size(*.8) placement(c))		   
		   text(6.3 2010 "Joseph" "Kabila",size(*.8) placement(c))	
		   ;
	#delimit cr		
	graph export "$path\figure_9.tif", as(tif) replace width(1500)		
			
	
	****************************************************************************
	*Figure 10. Variation across PR-using dictators
	****************************************************************************		
	
	*Loading data
	use "$path\replication_data_figure_10.dta", clear		
		
	*Graph
	#delimit ;	
	twoway (dropline firms yaxis, horizontal lwidth(*.25) msize(*1.4) lcolor(black) mcolor(black))
			, 
			ysize(1)
			xsize(1.3)
			yscale(range(.25 14) noline titlegap(*10) reverse)
			xscale(range() noextend titlegap(*10))
			ylabel(
					1 "Mobutu Sese Seko (Zaire)"
					2 "José Eduardo dos Santos (Angola)"
					3 "Omar Bongo (Gabon)"
					4 "Leonid Brezhnev (Soviet Union)"
					5 "Chiang Ching-kuo (Taiwan)"
					6 "Francisco Franco (Spain)"
					8 "Nursultan Nazarbayev (Kazakhstan)"
					9 "Mohammad Reza Pahlavi (Iran)"
					10 "Augusto Pinochet (Chile)"
					11 "Fidel Castro (Cuba)"
					12 "Saddam Hussein (Iraq)"
					13 "Robert Mugabe (Zimbabwe)"
					, notick labgap(*2) angle(horizontal) nogrid
			)
			xlabel(0(10)30)
			ytitle("")						
			xtitle("Number of contracts")
			yline(7, lcolor(black) lpattern(dot))
			graphregion(color(white) lcolor(white) lalign(outside)  margin(r=2 l=-7)) 			
			legend(off)
	;
	#delimit cr			
	graph export "$path\figure_10.tif", as(tif) replace width(1500)	
			
	*Restoring 
	restore		
		
	
	****************************************************************************
	*Figure 11. Firms most heavily utilized by dictatorships
	****************************************************************************		
	
	*Loading data
	use "$path\replication_data_figure_11.dta", clear				
		
	*Graph
	#delimit ;	
	twoway (dropline contracts yaxis, horizontal lwidth(*.25) msize(*1.4) lcolor(black) mcolor(black))
			, 
			ysize(1)
			xsize(1.4)
			yscale(range(.25 20.5) noline titlegap(*10) reverse)
			xscale(range() noextend titlegap(*10))
			ylabel(1(1)20, valuelabel  notick labgap(*2) angle(horizontal) nogrid
			)
			xlabel(0(10)50)
			ytitle("")						
			xtitle("Number of contracts")
			graphregion(color(white) lcolor(white) lalign(outside)  margin(r=2 l=-7)) 			
			legend(off)
	;
	#delimit cr			
	graph export "$path\figure_11.tif", as(tif) replace width(1500)			
		
	
	
********************************************************************************
*
* Figures in appendix
*
********************************************************************************		
	
	****************************************************************************
	*Figure A.1.1. PR firm usage over time (GWF regime types)
	****************************************************************************	
	
	*Loading data
	use "$path\replication_data_analysis.dta", clear		
	
	*Preserving data
	preserve
		
	*Identifying authoritarian regimes using PR firms 
	gen party_firm=1 if bin_firm_strict_count==1 & gwf_party==1
	gen military_firm=1 if bin_firm_strict_count==1 & gwf_military==1
	gen personal_firm=1 if bin_firm_strict_count==1 & gwf_personal==1		
	gen monarchy_firm=1 if bin_firm_strict_count==1 & gwf_monarchy==1		
		
	*Collapsing data 
	#delimit ;
	collapse (sum) party_firm 
				   military_firm 
				   personal_firm 
				   monarchy_firm 
				   gwf_party 
				   gwf_military 
				   gwf_personal 
				   gwf_monarchy 
				   , by(year)	
				   ;
	#delimit cr
	
	*Generating complete time-series
	drop if year>2010 | year<1946
	
	*Calculating shares
	foreach type in party military personal monarchy {
		gen share_`type'_firm=(`type'_firm/gwf_`type')*100
	}
		
	*Reshaping data
	reshape long share_@, i(year) j(type) string
	sort type year
	rename share_ share
	gen type_num=.
	replace type_num=1 if regexm(type, "party")
	replace type_num=2 if regexm(type, "personal")
	replace type_num=3 if regexm(type, "military")
	replace type_num=4 if regexm(type, "monarchy")
	
	label define type 1 "Party" 2 "Personal" 3 "Military" 4 "Monarchy"
	label values type_num type
	
	*Graph
	#delimit ;
	twoway 	(scatter share year, color(gs13%50))
			(lpoly share year,
			bwidth(2)
			lcolor(black)
			lwidth(*1.5))
			, 
			by(type_num, note("")
				plotregion(lcolor(white)) 
				graphregion(color(white) lcolor(white) lalign(outside))
			    legend(off)	
		)
		ysize(1)
		xsize(1.25)			
		yscale(range(0 100) noextend titlegap(+2))
		ylabel(0(25)100, angle(horizontal) nogrid ) 
		xscale(range( ) noextend titlegap(+3))		
		xlabel(1950(10)2010, noticks)		
		xticks(1950(10)2010,tlength(*1))		
		ytitle("Share of autocracies using firms (%)", size(*1))
		xtitle("   	 Year", size(*1))
		subtitle( ,lcolor(black) bcolor(gs15) margin(t=1))
	;
	#delimit cr			
	graph export "$path\figure_a_1_1.pdf", as(pdf) replace			
		
	*Restoring data
	restore			
		
	
	****************************************************************************
	*Figure A.1.2. PR firm usage over time (GT regime types)
	****************************************************************************	
		
	*Preserving data
	preserve
		
	*Identifying dictatorship types using PR firms 
	gen spin_firm=1 if bin_firm_strict_count==1 & spin==1
	gen fear_firm=1 if bin_firm_strict_count==1 & fear==1		

	*Collapsing data 
	collapse (sum) spin_firm fear_firm spin fear, by(year)	
	
	*Calculating shares 
	foreach type in spin fear {
		gen share_`type'_firm=(`type'_firm/`type')*100
	}
	
	*Reshaping data
	reshape long share_@, i(year) j(type) string
	sort type year
	rename share_ share
	gen type_num=.
	replace type_num=1 if regexm(type, "fear")
	replace type_num=2 if regexm(type, "spin")
	
	label define type_gt 1 "Fear" 2 "Spin"
	label values type_num type_gt
	
	*Graph
	#delimit ;
	twoway 	(scatter share year, color(gs13%50))
			(lpoly share year,
			bwidth(4)
			lcolor(black)
			lwidth(*1.5))
			, 
			by(type_num, note("")
				plotregion(lcolor(white)) 
				graphregion(color(white) lcolor(white) lalign(outside))
			    legend(off)
				iscale(*1.2) 
		)
		ysize(1)
		xsize(1.75)			
		yscale(range(0 100) noextend titlegap(+2))
		ylabel(0(25)100, angle(horizontal) nogrid ) 
		xscale(range( ) noextend titlegap(+5))		
		xlabel(1950(10)2010, noticks labgap(+1)) //		
		xticks(1950(10)2010,tlength(*1))		
		ytitle("Share of dictatorship using firms (%)", size(*1.1))
		xtitle("   Year", size(*1.1))
		subtitle( ,lcolor(black) bcolor(gs15) margin(t=1))
	;
	#delimit cr	
	graph export "$path\figure_a_1_2.pdf", as(pdf) replace		
		
	*Restoring data
	restore				
		
	
	****************************************************************************
	*Figure A.1.3. Contract lengths
	****************************************************************************	
		
	*Loading data
	use "$path\replication_data_figure_a_1_3.dta", clear			
		
	*Inspecting average contract length
	sum contract_dur
	
	*Graph
	#delimit ;
	hist contract_dur,
		 lcolor(black)
		 lwidth(*.5)
		 lalign(center)
		 fcolor(gs12)
	     ysize(1)
		 xsize(1.2)
		 yscale(range( ) noextend titlegap(+2))
		 xscale(range(0 50) noextend titlegap(+2))		 
	 	 ylabel(, angle(horizontal) nogrid ) 
		 xlabel(0(10)50)		 
		 xtitle("Contract length (years)")
		 graphregion(color(white) lcolor(white) lalign(outside) ) 			
	;
	#delimit cr
	graph export "$path\figure_a_1_3.pdf", as(pdf) replace				
			
	
	
********************************************************************************
*
* Tables in manuscript
*
********************************************************************************
	
	*Loading data
	use "$path\replication_data_analysis.dta", clear				
	
	****************************************************************************
	*Table 2. Linear fixed effects regression for hiring of PR firms
	****************************************************************************	
			
	*Model 1
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_rep_score
		l_v2x_corr
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	

	*Model 2 
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 3 
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_cw_loint
		l_bin_coup_suc 		
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 4
	#delimit ;
	xtreg ln_firm_strict_count_start 
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 5
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr			

	

********************************************************************************
*
* Tables in online appendix
*
********************************************************************************	
	
	****************************************************************************
	*Table A.2.1. Summary statistics (PR firm usage)
	****************************************************************************		
	
	#delimit ;
	sum 
		
		ln_firm_strict_count_start
		bin_firm_strict_count_start
		ln_firm_strict_count

		l_rep_score
		l_v2x_corr
		tournament
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror	

		l_v2x_clpol_inv
		l_v2xnp_regcorr
		c_tournament
		l_ln_delta_metersofskyscrapers
		l_cw_incom_ter 
		l_cw_incom_gov
		l_bin_coup_regc_suc 
		l_bin_coup_resc_suc
		gwf_party 
		gwf_monarchy 
		gwf_personal
		gwf_military
		spin 
		fear
		
		l_ln_gdp_pc
		l_ln_e_pop
		l_fpdist
		post1995
		l_ln_firmstock_strict_count

		if vdem_autoc==1 
		;
	#delimit cr
	
	
	****************************************************************************
	*Table A.2.2. Summary statistics (PR firm effects)
	****************************************************************************		
	
	#delimit ;
	sum 
		
		bin_visit_secstate
		ln_visit_secstate
		
		bin_visit_president		
		ln_visit_president		

		ln_us_aid_economic
		ln_us_aid_military
		
		firm_strict_count_start

		fpdist
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 	

		if vdem_autoc==1 
		;
	#delimit cr	
	

	****************************************************************************
	*Table A.3.1. Controlling for dictatorship types
	****************************************************************************	
		
	*Model 1
	#delimit ;
	xtreg ln_firm_strict_count_start 
		spin 
		if 
		gt_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 2
	#delimit ;
	xtreg ln_firm_strict_count_start 
		fear 
		if 
		gt_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 3
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		spin 
		if 
		gt_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 4
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		fear 
		if 
		gt_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	

	****************************************************************************
	*Table A.3.2. Controlling for authoritarian regime types
	****************************************************************************		
			
	*Model 1
	#delimit ;
	xtreg ln_firm_strict_count_start 
		gwf_party gwf_monarchy gwf_personal
		if 
		gwf_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
	
	*Model 2
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		gwf_party
		if 
		gwf_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 3
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		gwf_monarchy
		if 
		gwf_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
	
	*Model 4
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		gwf_personal
		if 
		gwf_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 5
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		gwf_military
		if 
		gwf_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
			
	*Model 6
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		gwf_party gwf_monarchy gwf_personal
		if 
		gwf_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	

	****************************************************************************
	*Table A.3.3. Alternative measures of the dependent variable
	****************************************************************************				
		
	*Model 1
	#delimit ;
	xtreg bin_firm_strict_count_start 
		l_rep_score
		l_v2x_corr
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr				
				
	*Model 2
	#delimit ;
	xtreg bin_firm_strict_count_start 
		tournament
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 3
	#delimit ;
	xtreg bin_firm_strict_count_start 		
		l_cw_loint
		l_bin_coup_suc 		
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 4
	#delimit ;
	xtreg bin_firm_strict_count_start 
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 5
	#delimit ;
	xtreg bin_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
		
	*Model 6
	#delimit ;
	xtreg ln_firm_strict_count 
		l_rep_score
		l_v2x_corr
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 7 
	#delimit ;
	xtreg ln_firm_strict_count 
		tournament
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
	
	*Model 8
	#delimit ;
	xtreg ln_firm_strict_count 		
		l_cw_loint
		l_bin_coup_suc 		
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 9
	#delimit ;
	xtreg ln_firm_strict_count 
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 10
	#delimit ;
	xtreg ln_firm_strict_count 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	
	****************************************************************************
	*Table A.3.4. Alternative measures for countering criticism logic
	****************************************************************************				
	
	*Model 1
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_v2x_clpol_inv
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr			
	
	*Model 2
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_v2x_clpol_inv
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
		
	*Model 3
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_v2xnp_regcorr
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 4
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2xnp_regcorr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
			
	
	****************************************************************************
	*Table A.3.5. Alternative measures for maximizing publicity logic
	****************************************************************************				
	
	*Model 1
	#delimit ;
	xtreg ln_firm_strict_count_start 
		c_tournament
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 2
	#delimit ;
	xtreg ln_firm_strict_count_start 
		c_tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 3
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_ln_delta_metersofskyscrapers
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 4
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_ln_delta_metersofskyscrapers
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
	
	
	****************************************************************************
	*Table A.3.6. Alternative measures for stabilizing support
	****************************************************************************			
		
	*Model 1
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_cw_incom_ter l_cw_incom_gov
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 2
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_incom_ter l_cw_incom_gov
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
		
	*Model 3
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_bin_coup_regc_suc l_bin_coup_resc_suc
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 4
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_regc_suc l_bin_coup_resc_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
		
	
	****************************************************************************
	*Table A.3.7. Negative binomial fixed effects regressions
	****************************************************************************		
	
	*Model 1: Retrieving fixed effects variables  
	#delimit ;
	quietly xtreg ln_firm_strict_count_start 
		l_rep_score
		l_v2x_corr
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	quietly tab cowcode if e(sample)==1, gen(cfe_2_)
	
	*Model 1
	#delimit ;
	nbreg firm_strict_count_start 
		l_rep_score
		l_v2x_corr
		cfe_2_2-cfe_2_148
		if 
		vdem_autoc==1 
		, 
		cluster(cowcode)			
	;
	#delimit cr
	
	*Dropping fixed effects variables
	drop cfe_2_1-cfe_2_148	
	
	*Model 2: Retrieving fixed effects variables 
	#delimit ;
	quietly xtreg ln_firm_strict_count_start 
		tournament
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	quietly tab cowcode if e(sample)==1, gen(cfe_1_)
	
	*Model 2
	#delimit ;
	nbreg firm_strict_count_start 
		tournament
		cfe_1_2-cfe_1_165
		if 
		vdem_autoc==1 
		, 
		cluster(cowcode)	
	;
	#delimit cr
	
	*Dropping fixed effects variables
	drop cfe_1_1 - cfe_1_165	
	
	*Model 3: Retrieving fixed effects variables  
	#delimit ;
	quietly xtreg ln_firm_strict_count_start 
		l_cw_loint
		l_bin_coup_suc 		
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	quietly tab cowcode if e(sample)==1, gen(cfe_3_)		
	
	*Model 3: Attracting support 
	#delimit ;
	nbreg firm_strict_count_start 
		l_cw_loint
		l_bin_coup_suc 
		cfe_3_2-cfe_3_155
		if 
		vdem_autoc==1 
		, 
		cluster(cowcode)			
	;
	#delimit cr
	
	*Dropping fixed effects variables
	drop cfe_3_1-cfe_3_155		
	
	*Model 4: Retrieving fixed effects variables 
	#delimit ;
	quietly xtreg ln_firm_strict_count_start 
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	quietly tab cowcode if e(sample)==1, gen(cfe_4_)
	
	*Model 4
	#delimit ;
	nbreg firm_strict_count_start 
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		cfe_4_2-cfe_4_165
		if 
		vdem_autoc==1 
		, 
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Dropping fixed effects variables
	drop cfe_4_1-cfe_4_165		
	
	*Model 5: Retrieving fixed effects variables 
	#delimit ;
	quietly xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr			
	quietly tab cowcode if e(sample)==1, gen(cfe_5_)	
	
	*Model 5
	#delimit ;
	nbreg firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		cfe_5_2-cfe_5_148
		if 
		vdem_autoc==1 
		, 
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Dropping fixed effects variables
	drop cfe_5_1-cfe_5_148		
		
	
	****************************************************************************
	*Table A.3.8. Linear regressions with autocratic spell fixed effects
	****************************************************************************					
		
	*Preserving data
	preserve
			
	*Keeping identified autocratic spells
	keep if id_autoc_spell!=.
	
	*Declaring dataset as TSCS
	xtset id_autoc_spell year, yearly
	
	*Model 1 
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_rep_score
		l_v2x_corr
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(id_autoc_spell)			
	;
	#delimit cr
	
	*Model 2
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(id_autoc_spell)			
	;
	#delimit cr	
		
	*Model 3
	#delimit ;
	xtreg ln_firm_strict_count_start 		
		l_cw_loint
		l_bin_coup_suc 		
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(id_autoc_spell)			
	;
	#delimit cr
	
	*Model 4
	#delimit ;
	xtreg ln_firm_strict_count_start 
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(id_autoc_spell)			
	;
	#delimit cr	
	
	*Model 5
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(id_autoc_spell)			
	;
	#delimit cr
	
	*Restoring data
	restore				
		
	
	****************************************************************************
	*Table A.3.9. Linear regressions with decade and country fixed effects
	****************************************************************************					
				
	*Generating decade fixed effects
	gen decade=.
	replace decade=1 if year>=1945 & year<1950
	replace decade=2 if year>=1950 & year<1960
	replace decade=3 if year>=1960 & year<1970
	replace decade=4 if year>=1970 & year<1980
	replace decade=5 if year>=1980 & year<1990
	replace decade=6 if year>=1990 & year<2000
	replace decade=7 if year>=2000 & year<2010
	replace decade=8 if year>=2010 & year<=2022
	
	tab decade, gen(dec)
		
	*Model 1
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_rep_score
		l_v2x_corr
		dec2-dec8		
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr

	*Model 2 
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		dec2-dec8
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 3
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_cw_loint
		l_bin_coup_suc
 		dec2-dec8		
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 4
	#delimit ;
	xtreg ln_firm_strict_count_start 
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		dec2-dec8		
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 5
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		dec2-dec8		
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
			
	
	****************************************************************************
	*Table A.3.10. Additional control variables
	****************************************************************************					
								

	*Model 1
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		l_ln_gdp_pc
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 2
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		l_ln_e_pop	
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 3
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		l_fpdist	
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 4
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		l_ln_gdp_pc
		l_ln_e_pop
		l_fpdist
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
		
	
	****************************************************************************
	*Table A.3.11. Controlling for Lobbying Disclosure Act of 1995
	****************************************************************************		
		
	*Model 1
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_rep_score
		l_v2x_corr
		post1995
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	

	*Model 2
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		post1995
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 3
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_cw_loint
		l_bin_coup_suc
 		post1995
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 4
	#delimit ;
	xtreg ln_firm_strict_count_start 
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		post1995
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 5
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		post1995
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
	
	
	****************************************************************************
	*Table A.3.12. Controlling for stock of PR firms already hired
	****************************************************************************					

	*Model 1
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_rep_score
		l_v2x_corr
		l_ln_firmstock_strict_count
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 2
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_ln_firmstock_strict_count
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
			
	*Model 3
	#delimit ;
	xtreg ln_firm_strict_count_start 
		l_cw_loint
		l_bin_coup_suc 
		l_ln_firmstock_strict_count
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 4
	#delimit ;
	xtreg ln_firm_strict_count_start 
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		l_ln_firmstock_strict_count
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 5
	#delimit ;
	xtreg ln_firm_strict_count_start 
		tournament
		l_rep_score
		l_v2x_corr
		l_cw_loint
		l_bin_coup_suc 		
		new_uspres
		cubancrisis 
		coldwarend	
		waronterror
		l_ln_firmstock_strict_count
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
					
	
	****************************************************************************
	*Table A.4.1. Two-way linear fixed effects regression for US state visits (binary measure)
	****************************************************************************					
				
	*Model 1
	#delimit ;
	xtreg bin_visit_secstate
		firm_strict_count_start
		fpdist
		tournament
		l1_rep_score
		l1_v2x_corr
		l1_cw_loint
		l1_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
	
	*Model 2
	#delimit ;
	xtreg bin_visit_secstate
		l1_firm_strict_count_start
		l1_fpdist
		l1_tournament
		l2_rep_score
		l2_v2x_corr
		l2_cw_loint
		l2_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 3
	#delimit ;
	xtreg bin_visit_secstate
		l2_firm_strict_count_start
		l2_fpdist
		l2_tournament
		l3_rep_score
		l3_v2x_corr
		l3_cw_loint
		l3_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 4
	#delimit ;
	xtreg bin_visit_president
		firm_strict_count_start
		fpdist
		tournament
		l1_rep_score
		l1_v2x_corr
		l1_cw_loint
		l1_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr			
	
	*Model 5
	#delimit ;
	xtreg bin_visit_president
		l1_firm_strict_count_start
		l1_fpdist
		l1_tournament
		l2_rep_score
		l2_v2x_corr
		l2_cw_loint
		l2_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 6
	#delimit ;
	xtreg bin_visit_president
		l2_firm_strict_count_start
		l2_fpdist
		l2_tournament
		l3_rep_score
		l3_v2x_corr
		l3_cw_loint
		l3_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr
			
	
	****************************************************************************
	*Table A.4.2. Two-way linear fixed effects regression for US state visits (count measure)
	****************************************************************************					
	
	*Model 1
	#delimit ;
	xtreg ln_visit_secstate
		firm_strict_count_start
		fpdist
		tournament
		l1_rep_score
		l1_v2x_corr
		l1_cw_loint
		l1_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
	
	*Model 2
	#delimit ;
	xtreg ln_visit_secstate
		l1_firm_strict_count_start
		l1_fpdist
		l1_tournament
		l2_rep_score
		l2_v2x_corr
		l2_cw_loint
		l2_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
	
	*Model 3
	#delimit ;
	xtreg ln_visit_secstate
		l2_firm_strict_count_start
		l2_fpdist
		l2_tournament
		l3_rep_score
		l3_v2x_corr
		l3_cw_loint
		l3_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
	
	*Model 4
	#delimit ;
	xtreg ln_visit_president
		firm_strict_count_start
		fpdist
		tournament
		l1_rep_score
		l1_v2x_corr
		l1_cw_loint
		l1_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 5
	#delimit ;
	xtreg ln_visit_president
		l1_firm_strict_count_start
		l1_fpdist
		l1_tournament
		l2_rep_score
		l2_v2x_corr
		l2_cw_loint
		l2_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 6
	#delimit ;
	xtreg ln_visit_president
		l2_firm_strict_count_start
		l2_fpdist
		l2_tournament
		l3_rep_score
		l3_v2x_corr
		l3_cw_loint
		l3_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr		
	
		
	****************************************************************************
	*Table A.4.3. Two-way linear fixed effects regressions for US foreign aid
	****************************************************************************					

	*Model 1
	#delimit ;
	xtreg ln_us_aid_economic
		firm_strict_count_start
		fpdist
		tournament
		l1_rep_score
		l1_v2x_corr
		l1_cw_loint
		l1_bin_coup_suc 
		i.year
		if
		vdem_autoc==1 
		, 
		fe		
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 2
	#delimit ;
	xtreg ln_us_aid_economic
		l1_firm_strict_count_start
		l1_fpdist
		l1_tournament
		l2_rep_score
		l2_v2x_corr
		l2_cw_loint
		l2_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 3
	#delimit ;
	xtreg ln_us_aid_economic
		l2_firm_strict_count_start
		l2_fpdist
		l2_tournament
		l3_rep_score
		l3_v2x_corr
		l3_cw_loint
		l3_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	

	*Model 4
	#delimit ;
	xtreg ln_us_aid_military
		firm_strict_count_start
		fpdist
		tournament
		l1_rep_score
		l1_v2x_corr
		l1_cw_loint
		l1_bin_coup_suc 
		i.year
		if
		vdem_autoc==1 
		, 
		fe		
		cluster(cowcode)			
	;
	#delimit cr
	
	*Model 5
	#delimit ;
	xtreg ln_us_aid_military
		l1_firm_strict_count_start
		l1_fpdist
		l1_tournament
		l2_rep_score
		l2_v2x_corr
		l2_cw_loint
		l2_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	*Model 6
	#delimit ;
	xtreg ln_us_aid_military
		l2_firm_strict_count_start
		l2_fpdist
		l2_tournament
		l3_rep_score
		l3_v2x_corr
		l3_cw_loint
		l3_bin_coup_suc 
		i.year
		if 
		vdem_autoc==1 
		, 
		fe
		cluster(cowcode)			
	;
	#delimit cr	
	
	
********************************************************************************	
*
*
*	
********************************************************************************		
	
	*Closing graph windows
	graph close _all 
	
	*Clearing data
	clear all
	
	*End recording log file
	log close	
	
